/*
 * @Author: your name
 * @Date: 2021-03-16 10:50:56
 * @LastEditTime: 2021-09-15 10:48:40
 * @LastEditors: Please set LastEditors
 * @Description: 全局过滤器注册
 * @FilePath: \sass\common\filter\index.js
 */
import Vue from "vue";
const filters = {};
// 支付类型
/* filters.filterPayType = (value) =>
    ({
        1: "一般意向",
        2: "中度意向",
        3: "高度意向",
    }[value] || "其他"); */

// 过滤手机号
filters.filterIphone = (value) => {
    return value.replace(value.substring(3, 7), "****");
};

// 过滤手机号
filters.filterFileName = (value) => {
    return value.length > 17 ? value.replace(value.substring(8, value.length - 10), "...") : value;
};

const mountFilters = (Vue) => {
    for (const i in filters) {
        Vue.filter(i, filters[i]);
    }
};

mountFilters(Vue);